Skip to content

Conversation

@Calboot
Copy link
Contributor

@Calboot Calboot commented Dec 14, 2025

具体改动

  • 修复了资源包管理界面元素边框过粗的问题
  • 修复资源包依赖模组下载错误的问题
  • 修复光影包下载对话框标题错误的问题
  • 添加启用/禁用资源包功能(实验性,有警告)
  • 添加资源包详细信息界面
  • 移除资源包删除按钮,改为与模组界面一致的删除逻辑
  • Fixes [Bug] 实例管理-资源包管理 页面有概率无法用esc退回到主界面 #5037
  • 从一些类里抽象出LocalAddonFileLocalFileManager<T extends LocalAddonFile>,使更新对于模组以外的东西(如资源包和光影包)也能适用,从而实现了资源包更新(不保留旧版本)
  • 让资源包光影包下载也有推荐项

@Calboot
Copy link
Contributor Author

Calboot commented Dec 14, 2025

需要懂其他语言的人完善 i18n

@Calboot Calboot changed the title [Enhancement] 资源包有关优化与修复 [Enhancement] [Bugfix] 资源包有关优化与修复 Dec 14, 2025
Copy link
Contributor

@3gf8jv4dv 3gf8jv4dv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我在 CF 和 MR 分别下载了好几个资源包,结果都显示「游戏版本元数据缺失」。如果真的要为这个显示警告的话,可能很多人都会迷惑。

可能是我搞错了,我还在弄清楚这一块。

@3gf8jv4dv
Copy link
Contributor

我下载了 Translations for Sodium,放在 1.21.9~1.21.11 的资源包文件夹内,启动器会显示「游戏版本元数据缺失」。1.21.8 和 1.21.1 正常。不知道是不是 bug。

Calboot and others added 2 commits December 17, 2025 21:28
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
Co-authored-by: 3gf8jv4dv <3gf8jv4dv@gmail.com>
@Calboot
Copy link
Contributor Author

Calboot commented Dec 17, 2025

我下载了 Translations for Sodium,放在 1.21.9~1.21.11 的资源包文件夹内,启动器会显示「游戏版本元数据缺失」。1.21.8 和 1.21.1 正常。不知道是不是 bug。

确实是,我在修

@Calboot
Copy link
Contributor Author

Calboot commented Dec 18, 2025

我下载了 Translations for Sodium,放在 1.21.9~1.21.11 的资源包文件夹内,启动器会显示「游戏版本元数据缺失」。1.21.8 和 1.21.1 正常。不知道是不是 bug。

Solved

@Calboot Calboot marked this pull request as ready for review December 18, 2025 14:53
@Calboot Calboot requested a review from Glavo December 27, 2025 04:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 47 out of 47 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (3)

HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/UpdatesPage.java:305

  • In the UpdateTask constructor, the lambda on line 295 captures the isDisabled variable and uses ModManager.DISABLED_EXTENSION. While ModManager inherits this constant from LocalFileManager, it would be clearer and more maintainable to use LocalFileManager.DISABLED_EXTENSION since this code now works with generic LocalAddonFile instances that could be from ResourcePackManager as well.
    HMCLCore/src/main/java/org/jackhuang/hmcl/mod/LocalModFile.java:164
  • This method overrides LocalAddonFile.setOld; it is advisable to add an Override annotation.
    public void setOld(boolean old) throws IOException {

HMCLCore/src/main/java/org/jackhuang/hmcl/mod/LocalModFile.java:103

    public Path getFile() {

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/download/DownloadPage.java
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java
@Calboot Calboot changed the title [Enhancement] [Bugfix] [Feature] 资源包有关优化与修复 [Feature] [Bugfix] 资源包有关优化与修复 Jan 2, 2026
Calboot added 11 commits January 3, 2026 18:43
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/download/DownloadPage.java
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/DownloadPage.java
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPageSkin.java
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/ModListPage.java
#	HMCLCore/src/main/java/org/jackhuang/hmcl/mod/curse/CurseForgeRemoteModRepository.java
#	HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modinfo/PackMcMeta.java
#	HMCLCore/src/main/java/org/jackhuang/hmcl/mod/modrinth/ModrinthRemoteModRepository.java
# Conflicts:
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/AddonUpdatesPage.java
#	HMCL/src/main/java/org/jackhuang/hmcl/ui/versions/CheckUpdatesTask.java
#	HMCLCore/src/main/java/org/jackhuang/hmcl/mod/LocalModFile.java
# Conflicts:
#	HMCLCore/src/main/java/org/jackhuang/hmcl/mod/ModLoaderType.java
#	HMCLCore/src/main/java/org/jackhuang/hmcl/mod/ModManager.java

private void setSelectedEnabled(List<ResourcePackInfoObject> selectedItems, boolean enabled) {
if (!ConfigHolder.globalConfig().isResourcePackWarningShown()) {
Controllers.confirmWithCountdown(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

confirmWithCountdown 应当仅用于风险极高的场景,比如我们对于非法用户名使用该方法的原因是非法用户名会有很大概率导致高版本游戏崩溃,所以我们通过它来警告用户这是一项高风险操作。

但是禁用资源包的风险性远远没有这么高,甚至还不如禁用模组的风险高,我认为在这里使用 confirmWithCountdown 完全是在滥用。考虑到我们在禁用模组时都没有提示,我认为现在在这里加提示的必要性很低。

}

@SerializedName("resourcePackWarningShown")
private final BooleanProperty resourcePackWarningShown = new SimpleBooleanProperty(false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这些东西没有必要放在 GlobalConfig 里。GlobalConfig 里放的东西要么是和用户平台相关的(比如 Java 列表),要么是用户许可等要求每个新用户确认的东西。常规的内容应该放在 Config 而不是 GlobalConfig 里。

private final String pageUrl;
private final String iconUrl;
private final IMod data;
private final RemoteModRepository.Type repoType;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

repoType 这个名字太怪异了,会让人误解成仓库的类型。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

5 participants